|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnegotiator.protocol.Protocol
negotiator.protocol.alternatingoffers.AlternatingOffersProtocol
public class AlternatingOffersProtocol
Manager of the Alternating Offers protocol:
Loads and initializes agents, domain, etc. Signals the start/stop of negotiations by calling BilateralAtomicNegotiationSession.
Manages time-outs.
| Field Summary | |
|---|---|
protected Agent |
agentA
|
protected Agent |
agentB
|
static int |
ALTERNATING_OFFERS_AGENT_A_INDEX
|
static int |
ALTERNATING_OFFERS_AGENT_B_INDEX
|
protected java.lang.String |
startingAgent
|
| Fields inherited from class negotiator.protocol.Protocol |
|---|
domain, negoThread, sessionNr, stopNegotiation, totalSessions, tournamentRunner |
| Constructor Summary | |
|---|---|
AlternatingOffersProtocol(AgentRepItem[] agentRepItems,
ProfileRepItem[] profileRepItems,
java.util.HashMap<AgentParameterVariable,AgentParamValue>[] agentParams,
int totalSessionRounds)
RUN A NEGO SESSION. |
|
| Method Summary | |
|---|---|
void |
addNegotiationPaths(int sessionNumber,
java.util.ArrayList<BidPoint> pAgentABids,
java.util.ArrayList<BidPoint> pAgentBBids)
Call this method to draw the negotiation paths on the chart with analysis. |
protected static java.util.ArrayList<AlternatingOffersProtocol> |
allParameterCombis(Tournament tournament,
AgentRepItem agentA,
AgentRepItem agentB,
ProfileRepItem profileA,
ProfileRepItem profileB)
This is a recursive function that iterates over all *parameters* and tries all values for each, recursively calling itself to iterate over the remaining parameters. |
protected static void |
allParameterCombis(Tournament tournament,
java.util.ArrayList<AssignedParameterVariable> allparameters,
java.util.ArrayList<AlternatingOffersProtocol> sessions,
ProfileRepItem profileA,
ProfileRepItem profileB,
AgentRepItem agentA,
AgentRepItem agentB,
java.util.ArrayList<AssignedParamValue> chosenvalues)
adds all permutations of all NegotiationSessions to the given sessions array. |
static void |
closeLog(boolean extensive)
|
void |
createExtraLogData()
Append quality measure information to the additional outcome field. |
Agent |
getAgent(int index)
|
java.lang.String |
getAgentAname()
|
java.util.HashMap<AgentParameterVariable,AgentParamValue> |
getAgentAparams()
|
AgentRepItem |
getAgentARep()
|
java.lang.String |
getAgentAStrategyName()
|
UtilitySpace |
getAgentAUtilitySpace()
|
java.lang.String |
getAgentBname()
|
java.util.HashMap<AgentParameterVariable,AgentParamValue> |
getAgentBparams()
|
AgentRepItem |
getAgentBRep()
|
java.lang.String |
getAgentBStrategyName()
|
UtilitySpace |
getAgentBUtilitySpace()
|
Domain |
getDomain()
|
java.lang.String |
getName()
|
NegotiationOutcome |
getNegotiationOutcome()
|
java.lang.String |
getOutcome()
|
ProfileRepItem |
getProfileArep()
|
ProfileRepItem |
getProfileBrep()
|
AlternatingOffersBilateralAtomicNegoSession |
getSessionRunner()
|
java.lang.String |
getStartingAgent()
|
java.lang.Integer |
getTotalTime()
|
static java.util.ArrayList<Protocol> |
getTournamentSessions(Tournament tournament)
Called when you press start button in Tournament window via reflection in TournamentRunner. |
static java.util.ArrayList<Protocol> |
getTournamentSessions(Tournament tournament,
boolean selfplay,
boolean both_sides)
|
protected AlternatingOffersBilateralAtomicNegoSession |
newAlternatingOffersBilateralAtomicNegoSession()
|
void |
run()
Warning. |
protected void |
runNegotiationSession()
Run a negotiation session. |
void |
startNegotiation()
this runs sessionTotalNumber of sessions with the provided settings |
void |
stopNegotiation()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int ALTERNATING_OFFERS_AGENT_A_INDEX
public static final int ALTERNATING_OFFERS_AGENT_B_INDEX
protected java.lang.String startingAgent
protected Agent agentA
protected Agent agentB
| Constructor Detail |
|---|
public AlternatingOffersProtocol(AgentRepItem[] agentRepItems,
ProfileRepItem[] profileRepItems,
java.util.HashMap<AgentParameterVariable,AgentParamValue>[] agentParams,
int totalSessionRounds)
throws java.lang.Exception
java.lang.Exception| Method Detail |
|---|
public void run()
public void startNegotiation()
throws java.lang.Exception
java.lang.Exception
protected void runNegotiationSession()
throws java.lang.Exception
nr - is the sessionTestNumber
java.lang.Exceptionpublic void createExtraLogData()
outcome field.
protected AlternatingOffersBilateralAtomicNegoSession newAlternatingOffersBilateralAtomicNegoSession()
throws java.lang.Exception
java.lang.Exceptionpublic static void closeLog(boolean extensive)
public void stopNegotiation()
stopNegotiation in class Protocolpublic java.lang.String toString()
toString in class Protocolpublic java.lang.String getOutcome()
public void addNegotiationPaths(int sessionNumber,
java.util.ArrayList<BidPoint> pAgentABids,
java.util.ArrayList<BidPoint> pAgentBBids)
pAgentABids - pAgentBBids - public Domain getDomain()
getDomain in class Protocolpublic UtilitySpace getAgentAUtilitySpace()
public UtilitySpace getAgentBUtilitySpace()
public java.lang.String getAgentAname()
public java.lang.String getAgentBname()
public java.util.HashMap<AgentParameterVariable,AgentParamValue> getAgentAparams()
public java.util.HashMap<AgentParameterVariable,AgentParamValue> getAgentBparams()
public ProfileRepItem getProfileArep()
public ProfileRepItem getProfileBrep()
public AgentRepItem getAgentARep()
public AgentRepItem getAgentBRep()
public java.lang.String getAgentAStrategyName()
public java.lang.String getAgentBStrategyName()
public java.lang.Integer getTotalTime()
public java.lang.String getStartingAgent()
public AlternatingOffersBilateralAtomicNegoSession getSessionRunner()
public java.lang.String getName()
getName in class Protocolpublic NegotiationOutcome getNegotiationOutcome()
getNegotiationOutcome in class Protocolpublic Agent getAgent(int index)
public static java.util.ArrayList<Protocol> getTournamentSessions(Tournament tournament)
throws java.lang.Exception
TournamentRunner.
This builds the sessions array from given Tournament vars
The procedure skips sessions where both sides use the same preference profiles.
exception - if something wrong with the variables, eg not set.
java.lang.Exception
public static java.util.ArrayList<Protocol> getTournamentSessions(Tournament tournament,
boolean selfplay,
boolean both_sides)
throws java.lang.Exception
java.lang.Exception
protected static java.util.ArrayList<AlternatingOffersProtocol> allParameterCombis(Tournament tournament,
AgentRepItem agentA,
AgentRepItem agentB,
ProfileRepItem profileA,
ProfileRepItem profileB)
throws java.lang.Exception
sessions - is the final result: all valid permutations of variables.varnr - is the index of the variable in the variables array.
exception - if one of the variables contains no values (which would prevent any
running sessions to be created with that variable.
java.lang.Exception
protected static void allParameterCombis(Tournament tournament,
java.util.ArrayList<AssignedParameterVariable> allparameters,
java.util.ArrayList<AlternatingOffersProtocol> sessions,
ProfileRepItem profileA,
ProfileRepItem profileB,
AgentRepItem agentA,
AgentRepItem agentB,
java.util.ArrayList<AssignedParamValue> chosenvalues)
throws java.lang.Exception
allparameters - the parameters of the agents that were selected for this nego session.sessions -
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||